#include <stdio.h>  
#include "element.h"


void renseignerChampsElem(Elem * e, int x, int y, int t)
{
  e->x = x;
  e->y = y;
  e->type_de_forme = t;
}


void afficherElem(Elem e)
{
  switch (e.type_de_forme)
    {
    case ARBUSTE:   printf("Arbuste   "); break;
    case BUISSON:   printf("Buisson   "); break;
    case BARRIERE:  printf("Barriere  "); break;
    case CLOWN:     printf("Clown     "); break;
    case OISEAU:    printf("Oiseau    "); break;
    case MAGICIEN:  printf("Magicien  "); break;
    case MOUSTACHU: printf("Moustachu "); break;
    default: printf("Forme inconnue "); break;
    }
  printf("en x=%d et en y=%d ", e.x, e.y);
}

void affecterElem(Elem * e1, Elem e2)
{
  e1->x = e2.x;
  e1->y = e2.y;
  e1->type_de_forme = e2.type_de_forme;
}

int estInferieurEnY(Elem e1, Elem e2)
{
  if (e1.y < e2.y) return 1;
  else return 0;
}

int estSuperieurEnY(Elem e1, Elem e2)
{
  if (e1.y > e2.y) return 1;
  else return 0;
}

int estSuperieurOuEgalEnY(Elem e1, Elem e2)
{
  if (e1.y >= e2.y) return 1;
  else return 0;
}


int estIdentique(Elem e1, Elem e2)
{
  if ((e1.x == e2.x) && (e1.y == e2.y) && (e1.type_de_forme == e2.type_de_forme)) return 1;
  else return 0;
}


